<?php

namespace Modules\Admin\Http\Controllers;

use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Modules\Admin\Services\AuthGroupService;

class AuthGroupController extends Controller
{
    protected $service = null;

    public function __construct()
    {
        $this->service = new AuthGroupService();
    }

    /**
     * Display a listing of the resource.
     * @return Response
     */
    public function index(Request $request): JsonResponse
    {
      return $this->service->list();
    }

    /**
     * Store a newly created resource in storage.
     * @param Request $request
     * @return Response
     */
    public function store(Request $request): JsonResponse
    {
        $data = $request->only([
            'name',
            'rules'
        ]);

        return $this->service->store($data);
    }

    /**
     * Show the specified resource.
     * @param int $id
     * @return Response
     */
    public function show($id)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     * @param Request $request
     * @param int $id
     * @return Response
     */
    public function update(Request $request, $id)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     * @param int $id
     * @return Response
     */
    public function destroy($id)
    {
        //
    }
}
